HTML - tags - embed tag

revision:


Content

"embed" tag : embeds external content in a document syntax some examples


"embed" tag : embeds external content in a document

top

The <embed> HTML element embeds external content at the specified point in the document. This content is provided by an external application or other source of interactive content such as a browser plug-in. It defines a container for an external resource, such as a web page, a picture, a media player, or a plug-in application.

Attributes: the <embed> element includes the global attributes and also supports the following attributes:

height : the displayed height of the resource, in CSS pixels. This must be an absolute value; percentages are not allowed.

src : the URL of the resource being embedded.

type : the MIME type (or media type) to use to select the plug-in to instantiate.

width : the displayed width of the resource, in CSS pixels. This must be an absolute value; percentages are not allowed.

Notes:

Use the "object-position" property to adjust the positioning of the embedded object within the element's frame, and the "object-fit" property to control how the object's size is adjusted to fit within the frame.

Use the "title" attribute on an embed element to label its content so that people navigating with assistive technology - such as a screen reader - can understand what it contains.

To display a picture, it is better to use the "<img> tag"; to display HTML, it is better to use the "<iframe> tag"; to display video or audio, it is better to use the "<video>" and "<audio>" tags.

Keep in mind that most modern browsers have deprecated and removed support for browser plug-ins, so relying upon <embed> is generally not wise if you want your site to be operable on the average user's browser.


syntax

top

<embed type=" " src=" " width=" " height=" ">


some examples

top
code:
                <div class="spec">
                    <embed class="example" type="image/jpg" src="../../pics/5.jpg" width="300" height="200" title="holidays">
                </div>
            
code:
                <embed class="example" type="text/html" src="demo_iframe.htm"  width="400" height="200">
            

code:
                <embed src="../../pics/blog-20-12-05.pdf" type="application/pdf" width="100%" height="300px" />